<template>
    <div id="dialog" v-cloak>
        <van-overlay :show="show" z-index="20">
            <div class="wrapper" @click.stop>
                <div>
                    <div class="close">
                        <div class=" textC" :class="(isold?' font44':' font32 font600')">{{ title }}</div>
                        <div class="textC font32 color">{{ text }}</div>
                    </div>
                    <div class="bgWhite disFlex btop">
                        <div @click="pop_close" class="right_b fontBlack2" :class="(isold?' font40':' font32')">取消</div>
                        <div @click="pop_sub" class=" fontGreenBlue" :class="(isold?' font40':' font32')">确定</div>
                    </div>
                </div>
            </div>
        </van-overlay>
    </div>
</template>
<script>
export default {
    name: 'dialog',
    props: {
        title: {
            type: String
        },
        text: {
            type: String
        },
        show: {
            type: Boolean
        },
        isold: {
            type: Boolean,
            default:false
        }
    },
    methods: {
        pop_close() {
            this.$parent.ispopClose();
        },
        pop_sub() {
            this.$parent.ispopSub();
        }
    }
}
</script>

<style scoped>
.wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.close {
    width: 5.82rem;
    padding: 0.48rem;
    background-color: white;
    border-radius: 0.16rem 0.16rem 0 0;
}

.color {
    color: rgb(0 0 0 / 40%);
    padding-top: 0.16rem;
}

.btop {
    border-top: 0.02rem solid #E8E9EC;
    border-radius: 0 0 0.16rem 0.16rem;
}

.btop div {
    width: 2.9rem;
    text-align: center;
    padding: 0.34rem 0;
}

.right_b {
    border-right: 0.02rem solid #E8E9EC;
}
</style>